<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let numbers = [10, 20, 30, 40, 50];
        // push方法用于在数组末尾添加一个或多个元素,并且返回新数组的长度
        document.write(numbers.push(60, 70) + "<br>");
        document.write("Updated Array: " + numbers + "<br>");

        // unshift方法用于在数组开头添加一个或多个元素,并且返回新数组的长度
        document.write(numbers.unshift(0) + "<br>");
        document.write("Updated Array: " + numbers + "<br>");
    </script>
</body>

</html>